package com.service.actions;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class SignInAction extends ActionSupport {
	
	private String userName;
	private String password;
	
	public String signIn() {
		System.out.println("Username : "+userName+" Password : "+password);
		if ("admin".equals(userName) && "admin".equals(password)) {
			  Map session = ActionContext.getContext().getSession();
			  session.put("logged-in","true");
			  return SUCCESS;
			  }
			  else{
			 return ERROR;
			  }
	}
	 public void setPassword(String password) {
		  this.password = password;
	}
	 public void setUserName(String userName) {
		  this.userName = userName;
	 }
}
